package com.alibaba.nacos.common.task;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public abstract class AbstractDelayTask implements NacosTask {
    private long taskInterval;
    private long lastProcessTime = System.currentTimeMillis();

    public abstract void merge(AbstractDelayTask task);

    @Override
    public boolean shouldProcess() {
        return System.currentTimeMillis() >= this.lastProcessTime + this.taskInterval;
    }
}
